package com.blog.common.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.blog.common.domain.annotation.Convert;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 留言
 * </p>
 *
 * @author Valerie
 * @since 2023-03-11
 */
@Getter
@Setter
@TableName("tb_message")
@ApiModel(value = "Message对象", description = "留言")
public class Message implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty("昵称")
    @TableField("nickname")
    private String nickname;

    @ApiModelProperty("头像")
    @TableField("avatar")
    @Convert
    private String avatar;

    @ApiModelProperty("留言内容")
    @TableField("message_content")
    private String messageContent;

    @ApiModelProperty("用户ip")
    @TableField("ip_address")
    private String ipAddress;

    @ApiModelProperty("用户地址")
    @TableField("ip_source")
    private String ipSource;

    @ApiModelProperty("弹幕速度")
    @TableField("time")
    private Boolean time;

    @ApiModelProperty("是否审核")
    @TableField("is_review")
    private Integer isReview;

    @ApiModelProperty("发布时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty("修改时间")
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;

    @ApiModelProperty("1 删除 0 未删除")
    @TableField("is_delete")
    @TableLogic
    private Integer isDelete;
}
